﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Minestorm.Retro.Entities
{
    public class FireballMine : Mine
    {
        public FireballMine(GraphicsDevice graphics, MineSize mineSize, Vector2 position, float angle)
            : base(graphics, mineSize, position)
        {
            Angle = angle;
            Speed = Constants.Mine.Enemy_Speed;

            MineType = GameLogic.MineType.Fireball;
            HasFireball = true;

            switch (mineSize)
            {
                case Entities.MineSize.Large:
                    Points = 325;
                    break;
                case Entities.MineSize.Medium:
                    Points = 360;
                    break;
                case Entities.MineSize.Small:
                    Points = 425;
                    break;
            }
        }

        protected override void InitializeVectors()
        {
            var verticies = new VertexPositionColor[21];
            verticies[0] = new VertexPositionColor(new Vector3(-4, 4, 0), Constants.VectorColor);
            verticies[1] = new VertexPositionColor(new Vector3(-2f, 3.5f, 0), Constants.VectorColor);
            verticies[2] = new VertexPositionColor(new Vector3(2f, 3.5f, 0), Constants.VectorColor);
            verticies[3] = new VertexPositionColor(new Vector3(4, 4, 0), Constants.VectorColor);
            verticies[4] = new VertexPositionColor(new Vector3(3.5f, 2f, 0), Constants.VectorColor);
            verticies[5] = new VertexPositionColor(new Vector3(3.5f, -2f, 0), Constants.VectorColor);
            verticies[6] = new VertexPositionColor(new Vector3(4, -4, 0), Constants.VectorColor);
            verticies[7] = new VertexPositionColor(new Vector3(2f, -3.5f, 0), Constants.VectorColor);
            verticies[8] = new VertexPositionColor(new Vector3(-2f, -3.5f, 0), Constants.VectorColor);
            verticies[9] = new VertexPositionColor(new Vector3(-4, -4, 0), Constants.VectorColor);
            verticies[10] = new VertexPositionColor(new Vector3(-3.5f, -2f, 0), Constants.VectorColor);
            verticies[11] = new VertexPositionColor(new Vector3(-3.5f, 2f, 0), Constants.VectorColor);

            verticies[12] = new VertexPositionColor(new Vector3(0, 0, 0), Constants.VectorColor);
            verticies[13] = new VertexPositionColor(new Vector3(-.3f, 0, 0), Constants.VectorColor);
            verticies[14] = new VertexPositionColor(new Vector3(-.2f, .2f, 0), Constants.VectorColor);
            verticies[15] = new VertexPositionColor(new Vector3(0, .3f, 0), Constants.VectorColor);
            verticies[16] = new VertexPositionColor(new Vector3(.2f, .2f, 0), Constants.VectorColor);
            verticies[17] = new VertexPositionColor(new Vector3(.3f, 0, 0), Constants.VectorColor);
            verticies[18] = new VertexPositionColor(new Vector3(.2f, -.2f, 0), Constants.VectorColor);
            verticies[19] = new VertexPositionColor(new Vector3(0, -.3f, 0), Constants.VectorColor);
            verticies[20] = new VertexPositionColor(new Vector3(-.2f, -.2f, 0), Constants.VectorColor);

            SetVerticies(verticies);

            SetIndicies(
                new NamedShortArray("mine", true, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 0),
                new NamedShortArray("fireball", true, 12, 13, 12, 14, 12, 15, 12, 16, 12, 17, 12, 18, 12, 19, 12, 20)
                );
        }

        protected override int ShellLineCount
        {
            get { return 12; }
        }
    }
}
